#include "DocInfoDBBase.h"
#include "tinyxml.h"
#include "tinystr.h"
#include "DocInfomation.h"

class MagicDocXmlDB: public DocInfoDBBase
{
protected:
    STRING m_dbPath;
    TiXmlDocument* m_document;

public:
    MagicDocXmlDB(STRING dbpath);
    ~MagicDocXmlDB();

    VEC_STRING GetAllFolders();
    void RemoveFolder(STRING folderName);
    void AddFolder(STRING folderName);

    void SaveInfo(const DocInfomation* const info);
    DocInfomation LoadInfo(STRING name);

    void CreateDB();
    void LoadDB();
    void ReleaseDB();
    void Flush();
};

